//
// Mirror.glsl
// Mirror
//
// Copyright (C) 2009
// Julius Parishy
//

uniform sampler2D webcam_texture;

uniform float elapsed_time;

void main()
{
	vec2 coord = gl_TexCoord[0].st;
/*
	float step = 1.0 / 6.28;
	float theta = coord.s * step;

	coord.t += sin(theta);
	gl_FragColor = texture2D(webcam_texture, coord.st); */

	coord.t += sin(1.0 * (1.0 / 6.28 * coord.s)) * 0.25;

	if(coord.t > 1)
	{
		float d = coord.t - 1.0;
		coord.t *= d / 1.0;
	}

	gl_FragColor = texture2D(webcam_texture, coord.st);
}
